import { createRouter, createWebHashHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
const Layout = () => import("@/layout/index.vue")

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: "/upair/index"
  },
  {
    path: "/experiment",
    name: "home",
    component: Layout,
    redirect: "/experiment/index",
    children: [
      {
        path: "index",
        name: "Experiment",
        component: () => import("@/pages/experiment/index.vue")
      },
      {
        path: 'speed',
        name: 'Speed',     
        component: () => import("@/pages/speed-page/index.vue")
      },
      {
        path: 'status',
        name: 'Status',     
        component: () => import("@/pages/connect-status/index.vue")
      },
      {
        path: "401",
        component: () => import("@/pages/error-page/401.vue"),
        meta: { hidden: true },
      },
      {
        path: "404",
        component: () => import("@/pages/error-page/404.vue"),
        meta: { hidden: true },
      }
    ]
  },
  {
    path: '/upair',
    component: Layout,
    redirect: "/upair/index",
    children: [
      {
        path: "index",
        name: "Upair",
        component: () => import('@/pages/upairs/index.vue')
      },
      {
        path: 'define-tm',
        name: 'Define',
        component: () => import('@/pages/define-telemetry/index.vue')
      }
    ]
  },
  {
    path: '/search',
    component: Layout,
    redirect: '/search/tm',
    children: [
      {
        path: 'tm',
        name: 'SearchTm',
        component: () => import('@/pages/search-page/search-tm.vue')
      },
      {
        path: 'tc',
        name: 'SearchTc',
        component: () => import('@/pages/search-page/search-tc.vue')
      }
    ]
  },
  {
    path: "/satellite_loads",
    name: "Loads",
    component: () => import('@/pages/upairs/params.vue')
  },
  {
    path: "/tm_charts",
    name: "TmCharts",
    component: () => import('@/pages/upairs/tm-charts.vue')
  },
  {
    path: '/tm_multi_charts',
    name: "TmMultiCharts",
    component: () => import('@/pages/upairs/tm-multi-chart.vue')
  },
  {
    path: '/navigation_loads',
    name: "Navigation",
    component: () => import('@/pages/upairs/nav-params.vue')
  },
  {
    path: '/ud_tm_loads',
    name: "UdTmlist",
    component: () => import('@/pages/upairs/ud-tm-params.vue')
  },
  {
    path: '/slow_tm_loads',
    name: "SlowTmlist",
    component: () => import('@/pages/upairs/slow-tm-params.vue')
  },
  // {
  //   path: "/define",
  //   component: Layout,
  //   redirect: '/define/index',
  //   children: [
  //     {
  //       path: 'index',
  //       name: 'Define',
  //       component: () => import('@/pages/define-telemetry/index.vue')
  //     }
  //   ]
  // },
  {
    path: "/401",
    component: () => import("@/pages/error-page/401.vue"),
    meta: { hidden: true },
  },
  {
    path: "/404",
    component: () => import("@/pages/error-page/404.vue"),
    meta: { hidden: true },
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
